<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="include :: header"></head>
<head>
    <style type="text/css">
        .td-left {
            text-align: left !important;
            padding-left: 5px;
        }

        .td-checkbox {
            vertical-align: middle;
            margin-top: 0px !important;
        }

        .td-label {
            vertical-align: middle;
            margin-bottom: 0px;
        }

        .td-radio {
            width: 13px !important;
            height: 13px !important;
            vertical-align: middle;
            margin-top: 0px !important;
        }

        .td-detail{
            font-weight: bold;
            vertical-align:middle;
            text-align: center;
        }
        .out tr td{

        }

    </style>
</head>
<body class="hold-transition skin-blue sidebar-mini">
<section class="content">
    <div class="row">
        <section class="content-header">
            <h1>
                项目任务单查看
            </h1>
        </section>
        <section class="content">
            <div class="box">
               <div class="box-body">
                    <form id="projectForm" class="form-horizontal">
                        <div class="col-xs-11" style="margin-left: 4%;">
                            <table class="t1">
                                <thead>
                                <tr>
                                    <td colspan="10" style="border: none">
                                        <img th:src="@{/img/logo3.jpg}" width="40px" height="40px" style="margin-top: -30px">
                                        <div style="display: inline-block;margin-top: 5px;margin-left: 20px">
                                            <span style="letter-spacing: 21px;display: block;line-height: 20px">&nbsp;辽宁忠旺机械设备制造有限公司</span>
                                            <span style="display: block;font-size: 12px;line-height: 20px">Liaoning Zhongwang Machinery Equipment Manufacturing Co., Ltd.</span>
                                        </div>
                                    </td>
                                </tr>
                                <tr >
                                    <td colspan="10" style="border: none;font-size: 30px;font-weight:bold;letter-spacing: 8px;">
                                        项目任务单
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="10" style="text-align: right; border: none;font-size: 12px;">
                                        表单编号：ZWJX-RL-050
                                    </td>
                                </tr>
                                <tr class="tr-detail" >
                                    <td width="6%" class="td-detail" style="font-size: 15px; line-height: 300%;">
                                        序号
                                    </td>
                                    <td width="18%" class="td-detail" style="font-size: 15px; line-height: 300%;">
                                        项目名称
                                    </td>
                                    <td width="13%" class="td-detail" style="font-size: 15px; line-height: 300%;">
                                        需方
                                    </td>
                                    <td width="13%" class="td-detail" style="font-size: 15px; line-height: 300%;">
                                        安装地点
                                    </td>
                                    <td width="9%" class="td-detail" style="font-size: 15px; line-height: 300%;">
                                        数量
                                    </td>
                                    <td width="11%" class="td-detail" style="font-size: 15px; line-height: 300%;">
                                        交货日期
                                    </td>
                                    <td colspan="2" class="td-detail" width="10%" style="font-size: 15px; line-height: 300%;">
                                        委托人
                                    </td>
                                    <td width="10%" class="td-detail" style="font-size: 15px; line-height: 300%;">
                                        委托日期
                                    </td>
                                    <td width="12%" class="td-detail" style="font-size: 15px; line-height: 300%;">
                                        联系方式
                                    </td>
                                </thead>
                                <tbody class="out">
                                <tr style="height: 50px;">
                                    <td style="font-size: 15px; line-height: 150%;">
                                        1
                                    </td>
                                    <td  style="font-size: 15px; line-height: 150%;">
                                        [[${proInvInfo.proName}]]
                                    </td>
                                    <td style="font-size: 15px; line-height: 150%;">
                                        [[${proInvInfo.customer}]]
                                    </td>
                                    <td  style="font-size: 15px; line-height: 150%;">
                                        [[${proInvInfo.insSite}]]
                                    </td>
                                    <td  style="font-size: 15px; line-height: 150%;">
                                        [[${proInvInfo.proQty}]] [[${proInvInfo.proUnit}]]
                                    </td>
                                    <td  style="font-size: 15px; line-height: 150%;">
                                        [[${proInvInfo.cusDeliveryDate}]]
                                    </td>
                                    <td colspan="2"  style="font-size: 15px; line-height: 150%;">
                                        [[${proInvInfo.principal}]]
                                    </td>
                                    <td style="font-size: 15px; line-height: 150%;">
                                       <span th:text="${#dates.format(proInvInfo.cusEntrustDate,'yyyy-MM-dd')}"></span>
                                    </td>
                                    <td  style="font-size: 15px; line-height: 150%;">
                                        [[${proInvInfo.tel}]]
                                    </td>
                                </tr>
                                <tr style="height: 50px">
                                    <td style="font-size: 15px; line-height: 200%;font-weight: bold">
                                        承揽</br>范围
                                    </td>
                                    <td colspan="9" style="font-size: 15px; line-height: 200%;text-align: left;padding-left: 10px">
                                        <img th:src="@{(${proInvInfo.design}==1?'/img/checked.png':'/img/nochecked.png')}"
                                             width="16px" height="16">&nbsp;设计</label>&nbsp;&nbsp;&nbsp;&nbsp;
                                        <img th:src="@{(${proInvInfo.meteral}==1?'/img/checked.png':'/img/nochecked.png')}"
                                             width="16px" height="16">&nbsp;材料</label>&nbsp;&nbsp;&nbsp;&nbsp;
                                        <img th:src="@{(${proInvInfo.manuf}==1?'/img/checked.png':'/img/nochecked.png')}"
                                             width="16px" height="16">&nbsp;制造</label>&nbsp;&nbsp;&nbsp;&nbsp;
                                        <img th:src="@{(${proInvInfo.pack}==1?'/img/checked.png':'/img/nochecked.png')}"
                                             width="16px" height="16">&nbsp;包装</label>&nbsp;&nbsp;&nbsp;&nbsp;
                                        <img th:src="@{(${proInvInfo.trans}==1?'/img/checked.png':'/img/nochecked.png')}"
                                             width="16px" height="16">&nbsp;运输</label>&nbsp;&nbsp;&nbsp;&nbsp;
                                        <img th:src="@{(${proInvInfo.install}==1?'/img/checked.png':'/img/nochecked.png')}"
                                             width="16px" height="16">&nbsp;安装</label>&nbsp;&nbsp;&nbsp;&nbsp;
                                        <img th:src="@{(${proInvInfo.debug}==1?'/img/checked.png':'/img/nochecked.png')}"
                                             width="16px" height="16">&nbsp;调试</label>&nbsp;&nbsp;&nbsp;&nbsp;
                                        <img th:src="@{(${proInvInfo.spareParts}==1?'/img/checked.png':'/img/nochecked.png')}"
                                             width="16px" height="16">&nbsp;备品备件</label>
                                    </td>
                                </tr>
                                <tr style="height: 150px">
                                    <td style="font-size: 15px; line-height: 200%;font-weight: bold;">
                                        主要</br>技术</br>要求
                                    </td>
                                    <td colspan="9"style="font-size: 15px; line-height: 200%;text-align: left">
                                        <p id="mainTechReq" name="mainTechReq" readonly="readonly" th:text="${proInvInfo.mainTechReq}"
                                           style="height: auto; padding: 10px; white-space: pre-wrap; background:none;margin-bottom: 0px; max-width: 100%; min-width: 100%;">
                                        </p>
                                    </td>
                                </tr>
                                <tr style="height: 150px">
                                    <td style="font-size: 15px; line-height: 200%;font-weight: bold">
                                        反&nbsp;&nbsp;&nbsp;馈</br>销售科</br>要&nbsp;&nbsp;&nbsp;求
                                    </td>
                                    <td colspan="9"style="font-size: 15px; line-height: 200%;text-align: left;">
                                        <p id="keyDateFeedback" name="keyDateFeedback" readonly="readonly" th:text="${proInvInfo.keyDateFeedback}"
                                           style="height: auto; padding: 10px; white-space: pre-wrap; background:none;margin-bottom: 0px; max-width: 100%; min-width: 100%;">
                                        </p>
                                    </td>
                                </tr>
                                <tr>
                                  <td colspan="2"  style="font-size: 15px; line-height: 300%;font-weight: bold">
                                      项目管理科科长签字
                                  </td>
                                    <td colspan="2" >
                                        <img width="150px" height="50px" name="proSecLeaderSign" style="margi-n-top: 0px;vertical-align: middle" th:if="${proInvInfo.proSecLeaderSign!= null}"
                                             th:src="@{${proInvInfo.proSecLeaderSign}}">
                                    </td>
                                    <td colspan="3" style="font-size: 15px; line-height: 300%;font-weight: bold">
                                        日期
                                    </td>
                                    <td colspan="3" style="font-size: 15px; line-height: 300%;font-weight: bold"
                                        th:text = "${proInvInfo.proSecLeaderDate == null? '': #dates.format(proInvInfo.proSecLeaderDate, 'yyyy-MM-dd')}">
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2" style="font-size: 15px; line-height: 300%;font-weight: bold">
                                        技术副总签字
                                    </td>
                                    <td colspan="2">
                                        <img width="150px" height="50px"  name="techLeaderSign" style="margi-n-top: 0px;vertical-align: middle" th:if="${proInvInfo.techLeaderSign != null}"
                                             th:src="@{${proInvInfo.techLeaderSign}}">&thinsp;
                                    </td>
                                    <td colspan="3" style="font-size: 15px; line-height: 300%;font-weight: bold">
                                        日期
                                    </td>
                                    <td colspan="3" style="font-size: 15px; line-height: 300%;font-weight: bold"
                                        th:text = "${proInvInfo.techLeaderDate == null? '': #dates.format(proInvInfo.techLeaderDate, 'yyyy-MM-dd')}">
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2" style="font-size: 15px; line-height: 300%;font-weight: bold">
                                        生产副总签字
                                    </td>
                                    <td colspan="2">
                                        <img width="150px" height="50px" name="prodLeaderSign" style="margi-n-top: 0px;vertical-align: middle" th:if="${proInvInfo.prodLeaderSign != null}"
                                             th:src="@{${proInvInfo.prodLeaderSign}}">
                                    </td>
                                    <td colspan="3" style="font-size: 15px; line-height: 300%;font-weight: bold">
                                        日期
                                    </td>
                                    <td colspan="3" style="font-size: 15px; line-height: 300%;font-weight: bold"
                                        th:text = "${proInvInfo.prodLeaderDate == null? '': #dates.format(proInvInfo.prodLeaderDate, 'yyyy-MM-dd')}">
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                    </form>
               </div>
                <!--<div class="row" th:if="${proInvInfo.proFileQty > 0}">-->
                    <!--<div class="col-xs-11" style="margin-left: 4%;margin-top: 20px; margin-bottom: 20px">-->
                        <!--<label class="pull-left" style="margin-bottom: 10px;">附件信息</label>-->
                        <!--<table id="bootstrap-table"></table>-->
                    <!--</div>-->
                <!--</div>-->
            </div>
        </section>
    </div>
</section>
<div th:include="include :: footer"></div>
<script th:inline="javascript">

    /** 替换特殊字符 */
    function toTextarea(str) {
        var reg = new RegExp("<br>", "g");
        var regSpace = new RegExp("&ensp;", "g");
        var regNull = new RegExp("null", "g");
        str = str.replace(reg, "\n");
        str = str.replace(regSpace, "");
        str = str.replace(regNull,"");
        return str;
    }

    let table;
    let table1;
    $(function () {
        var obj = [[${proInvInfo}]];
        $("#mainTechReq").html(toTextarea(obj.mainTechReq));
        $("#keyDateFeedback").html(toTextarea(obj.keyDateFeedback));

        //加载旧系统初始化过来的项目任务单文件列表
        table = js.table.init({
            url: ctx + "projectApprove/project/projectFileList",
            showExport: false,
            pagination: false,
            queryData: {
                proId: [[${proInvInfo.proId}]],
            },
            columns: [
                {
                    title: '序号', field: 'id', width: '50',
                    formatter: function (value, row, index) {
                        return index + 1;
                    }
                },
                {title: "文件名称", field: 'fileName'},
                {title: "上传人", field: 'createName', width: 100},
                {title: "上传时间", field: 'createTime', width: 110},
                {title: "文件备注", field: 'fileContent'},
                {
                    title: "操作", field: 'url', width: 130,
                    formatter: function (value, row) {
                        let actions = [];
                        actions.push('<a class="btn btn-primary btn-xs" href="' + value + '">下载</a> ');
                        return actions.join('');
                    }
                }
            ]
        });
    });
</script>
</body>
</html>
